﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace CarsApp
{
    public partial class Form1 : Form
    {
        Car Ford = new Car();
        Car BMW = new Car();
        Car CurrentCar = new Car();
        public Form1()
        {
            InitializeComponent();
            Ford.GetBrand = "Ford Mustang GT";
            BMW.GetBrand = "BMW 320";
            Ford.GetMileage = 120000;
            BMW.GetMileage = 10000;

           
            
        }

        int textBox_var;
        decimal textNumeric_var;
        int literInCar_var;
        int milage;
        private void RadioPrivateCar_CheckedChanged(object sender, EventArgs e)
        {
            if (RadioPrivateCar.Checked == true)
            {
                CurrentCar = Ford;
                LblCarBrand.Text = CurrentCar.GetBrand;
                LblMileage.Text = CurrentCar.GetMileage.ToString();

            }

        }

        private void RadioBussiness_CheckedChanged(object sender, EventArgs e)
        {
            CurrentCar = BMW;
            LblCarBrand.Text = CurrentCar.GetBrand;
            LblMileage.Text = CurrentCar.GetMileage.ToString();
        }

        private void BtnUpdate_Click(object sender, EventArgs e)
        {
            textBox_var = Int32.Parse(BoxText.Text);
            textNumeric_var = numericSet.Value;
            literInCar_var = Int32.Parse(textLitCar.Text);
            milage = 100000;
            BMW.UpdateChart(milage, textBox_var, textNumeric_var);
           
        }

        private void btnShow_Click(object sender, EventArgs e)
        {
            if (CurrentCar == BMW)
            {
                MessageBox.Show(BMW.GetFuelEfficiency(milage, textBox_var, literInCar_var, textNumeric_var).ToString());
            }

        }


        


    }
}
